/**
 * @returns 请求的地址
 */
export const basicUrl = () => {
  let url = "";
  if (process.env.NODE_ENV === "development") {
    url = "";
    //#ifdef APP-PLUS
    // url = "http://106.54.55.38:8080";
    //#endif
    // url = "/api"; http://106.54.55.38:8081
  } else {
    // url = "http://106.54.55.38:8080";
    // //#ifndef APP-PLUS
    // url = "http://106.54.55.38:8080";
    // //#endif
  }
  return url;
};

/**
 * @returns 跳转到pc端
 */
export const toPc = () => {
  let url = "";
  if (process.env.NODE_ENV === "development") {
    url = "http://192.168.8.24:8003/#/login";
  } else {
    url = "http://mes.cnrecyc.com/pc/#/login";
  }
  return url;
};

//  获取返回的地址
export const getRedirectUrl = () => {
  if (isDev()) {
    // 开发环境
    return "http://local.cnrecyc.com:8004/app/";
  } else {
    // 生产
    return "http://mes.cnrecyc.com/app/";
  }
};

/**
 * @param {string} devValue 开发环境值
 * @param {string} ProValue 生产环境值
 * @returns 根据环境不同生成显示不同内容
 */

export const useValue = (devValue: any, proValue: any) => (process.env.NODE_ENV === "development" ? devValue : proValue);
